HTMLify
style.css
Views: 6 | Author: huxn-webdev
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | * { box-sizing: border-box; margin: 0; padding: 0; } body { font-family: sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } nav { background: #fff; padding: 20px; width: 80px; display: flex; justify-content: center; align-items: center; border-radius: 3px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); transition: width 0.6s linear; } nav.active { width: 350px; } ul { display: flex; list-style: none; padding: 0; margin: 0; width: 0; transition: width 0.6s linear; } nav.active ul { width: 100%; } nav ul li { transform: rotate(0deg); opacity: 0; transition: transfrom 0.6s linear, opacity 0.6s linear; } nav.active ul li { opacity: 1; transform: rotateY(360deg); } nav ul a { position: relative; color: #000; text-decoration: none; margin: 0 10px; } .icon { background: #fff; border: 0; padding: 0; position: relative; height: 30px; width: 30px; outline: none; cursor: pointer; } .icon .line { background: crimson; height: 2px; width: 20px; position: absolute; top: 10px; left: 5px; transition: transfrom 0.6s linear; } .icon .line2 { top: auto; bottom: 10px; } nav.active .icon .line1 { transform: rotate(-765deg) translateY(5.5px); } nav.active .icon .line2 { transform: rotate(765deg) translateY(-5.5px); } |